class Address < ActiveRecord::Base
  belongs_to :province
  belongs_to :city
  belongs_to :region
  has_many   :orders

  TIMING = [
    [ "全天",   1 ],
    [ "工作日", 2 ],
    [ "休息日", 3 ]
  ]

  def title
    return (self.province ? self.province.name : "") <<
      (self.city ? self.city.name : "") << (self.region ? self.region.name : "") << self.street 
  end
end
